package com.woniu40.petai_manager.mapper;

import com.woniu40.petai_manager.entity.Article;
import com.woniu40.petai_manager.entity.Comment;
import com.woniu40.petai_manager.entity.Dynamic;
import com.woniu40.petai_manager.entity.Report;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.Timestamp;
import java.util.List;

@ResponseBody
public interface ReportMapper {
//    int deleteByPrimaryKey(Integer reportId);
//
//    int insert(Report record);
//
//    Report selectByPrimaryKey(Integer reportId);
//
//    List<Report> selectAll();
//
//    int updateByPrimaryKey(Report record);



    //获取图片

//遍历举报信息
//    List<Report> selectArtAll();
////获取举报次数
//    List<Report>selectDynAll();

    List<Report> selectCom(Integer state);
    //根据选择进行排序
    List<Report>selectDyn(Integer state);

    List<Report>selectComLate(Timestamp timestamp);
    List<Report>selectDynLate(Timestamp timestamp);

    @Select("select * from t_report where report_id=#{reportId} ")
    Report selectById(Integer reportId);
    //改变处理状态
    @Update("update t_report set state= 1 where report_id=#{reportId}")
    int updateState(Integer reportId);
     //批量改变处理状态
    @Update("update t_report set state= 1 where dynamic_id=#{dynamicId}")
    int updataDyn(Integer dynamicId);
    @Update("update t_report set state= 1 where comment_id=#{commentId}")
    int updataCom(Integer commentId);

}